var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    tabIndex: 0,
    tabs: ['未验证', '已验证']
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let that = this;
    that.setData({
      shop_id: options.shop_id,
      wid: options.wid
    })
    wx.showLoading({
      title: '加载中',
    })
    setTimeout(function(){
      that.getInfo();
      wx.hideLoading();
    },500)
    
  },
  backto: function (e) {
    wx.navigateBack({})
  },
  getInfo: function () {
    let that = this;
    wx.showLoading({
      title: '数据加载中…',
    })
    app.ihttpGet("https://www.58zltc.com/api.php/ShopAdmin/orderUnValidate/shop_id/" + that.data.shop_id + "/wid/" + that.data.wid, function (res) {
      if (res.data.err_code == 400) {
        app.iModel(res.data.err_msg);
      } else {
        console.log('ccccccccccccc');
        console.log(res.data);
        that.setData({
          list: res.data
        })
      }
    })
    app.ihttpGet("https://www.58zltc.com/api.php/ShopAdmin/orderIsValidate/shop_id/" + that.data.shop_id + "/wid/" + that.data.wid, function (res) {
      if (res.data.err_code == 400) {
        app.iModel(res.data.err_msg);
      } else {
        that.setData({
          couPon: res.data
        })
      }
    })
  },
  setTab: function (e) {
    const idx = e.currentTarget.dataset.index;
    this.setData({
      tabIndex: idx
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },
})